package com.simple.chiralium.upms.api.feign;

import com.simple.chiralium.common.core.constant.ServiceNameConstants;
import com.simple.chiralium.common.core.util.Result;
import com.simple.chiralium.upms.api.dto.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 远程用户服务
 *
 * @author SimpleZzz
 * @date 2021/12/05
 */
@Service
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteUserService {

    /**
     * 根据用户名获取用户信息
     *
     * @param username 用户名
     * @return {@link Result}<{@link UserInfo}>
     */
    @GetMapping("/user/info/{username}")
    Result<UserInfo> info(@PathVariable String username);

}
